# myapp/test_runner.py

from django.test.runner import DiscoverRunner

class NoDbTestRunner(DiscoverRunner):
    """A test runner to test without database creation"""
    def setup_databases(self, **kwargs):
        # 不创建数据库
        pass

    def teardown_databases(self, old_config, **kwargs):
        # 不销毁数据库
        pass
